
gcd.o:     file format elf32-littlearm


Disassembly of section .text:

00000000 <gcd>:
#include <stdio.h>

// 递归法求最大公约数，当最大公约数是1的时候，两个数互质
// if(gcd(x,y)==1)那么x,y互质
int gcd(int a, int b)
{
   0:	e92d4800 	push	{fp, lr}
   4:	e28db004 	add	fp, sp, #4
   8:	e24dd008 	sub	sp, sp, #8
   c:	e50b0008 	str	r0, [fp, #-8]		; a
  10:	e50b100c 	str	r1, [fp, #-12]		; b
	if (b == 0)
  14:	e51b300c 	ldr	r3, [fp, #-12]		; b
  18:	e3530000 	cmp	r3, #0              ; b == 0?
  1c:	1a000001 	bne	28 <gcd+0x28>       ; jump
		return a;
  20:	e51b3008 	ldr	r3, [fp, #-8] ; a
  24:	ea000008 	b	4c <gcd+0x4c> ; return a
	else 
		return gcd(b, a % b);
  28:	e51b3008 	ldr	r3, [fp, #-8]    ; a
  2c:	e51b100c 	ldr	r1, [fp, #-12]   ; b
  30:	e1a00003 	mov	r0, r3           ; r0 = a
  34:	ebfffffe 	bl	0 <__aeabi_idivmod> ; a % b
  38:	e1a03001 	mov	r3, r1              ; r3 = r1 = b
  3c:	e1a01003 	mov	r1, r3              ; r1 = r3 = b
  40:	e51b000c 	ldr	r0, [fp, #-12]      ; r0 = b
  44:	ebfffffe 	bl	0 <gcd>
  48:	e1a03000 	mov	r3, r0
}
  4c:	e1a00003 	mov	r0, r3
  50:	e24bd004 	sub	sp, fp, #4
  54:	e8bd8800 	pop	{fp, pc}

00000058 <main>:

void main()
{
  58:	e92d4800 	push	{fp, lr}
  5c:	e28db004 	add	fp, sp, #4
  60:	e24dd010 	sub	sp, sp, #16
	int a, b, prime;

	a = 10;
  64:	e3a0300a 	mov	r3, #10
  68:	e50b3008 	str	r3, [fp, #-8] ; a
	b = 5;
  6c:	e3a03005 	mov	r3, #5
  70:	e50b300c 	str	r3, [fp, #-12] ; b
	prime = 0;
  74:	e3a03000 	mov	r3, #0
  78:	e50b3010 	str	r3, [fp, #-16] ; prime

	prime = gcd(a, b);
  7c:	e51b100c 	ldr	r1, [fp, #-12] ; b
  80:	e51b0008 	ldr	r0, [fp, #-8]  ; a
  84:	ebfffffe 	bl	0 <gcd>
  88:	e50b0010 	str	r0, [fp, #-16]

	if (prime == 1) {
  8c:	e51b3010 	ldr	r3, [fp, #-16] ; prime
  90:	e3530001 	cmp	r3, #1
  94:	1a000002 	bne	a4 <main+0x4c>
		printf(" relatively prime (互质)\n");
  98:	e59f0018 	ldr	r0, [pc, #24]	; b8 <main+0x60>
  9c:	ebfffffe 	bl	0 <puts>
  a0:	ea000002 	b	b0 <main+0x58>
	}
	else {
		printf("%d\n", prime);
  a4:	e51b1010 	ldr	r1, [fp, #-16]
  a8:	e59f000c 	ldr	r0, [pc, #12]	; bc <main+0x64>
  ac:	ebfffffe 	bl	0 <printf>
	}
}
  b0:	e24bd004 	sub	sp, fp, #4
  b4:	e8bd8800 	pop	{fp, pc}
  b8:	00000000 	.word	0x00000000
  bc:	0000001c 	.word	0x0000001c
